package com.spzx.controller;

import com.spzx.common.core.domain.R;
import com.spzx.service.CategoryTreeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/category")
@Tag(name = "分类展示")
public class CategoryTreeController {
    @Resource
    CategoryTreeService categoryTreeService;

    @GetMapping("/tree")
    @Operation(summary = "分类树形列表展示")
    public R CategoryTree() {
        return R.ok(categoryTreeService.listTree());
    }
}
